<template>
  <router-view #default="{ Component }">
    <keep-alive :include="['CateView', 'MyView']">
      <component :is="Component"></component>
    </keep-alive>
  </router-view>
  <van-tabbar
    v-model="active"
    route
    active-color="#ee0a24"
    v-show="$route.meta.showTabbar == true"
    placeholder
    fixed
  >
    <van-tabbar-item icon="home-o" to="/">首页</van-tabbar-item>
    <van-tabbar-item icon="apps-o" to="/cate">分类</van-tabbar-item>
    <van-tabbar-item icon="shopping-cart-o" to="/cart" :badge="num">购物车</van-tabbar-item>
    <van-tabbar-item icon="user-o" to="/my">我的</van-tabbar-item>
  </van-tabbar>
</template>

<script setup>
import { ref } from 'vue'
import { num, getCartList } from '@/stores/huibiao'
let active = ref(0)
</script>

<style scoped></style>
